import http from '../utils/http'

// 登录接口
export async function login(data: any = {}) {
  return http({
    url: '/user/login',
    method: 'POST',
    data,
  })
}

// 注册接口
export async function register(data: any = {}) {
  return http({
    url: '/user/register',
    method: 'POST',
    data,
  })
}

// 首页banner图请求接口
export const fetchBanner = async (data: any = {}) => {
  return http({
    url: '/banner/bannerList',
    method: 'POST',
    data: {
      pageNum: '1',
      pageSize: '10',
      ...data,
    },
  })
}

// 暂时不报错，写死
export function getUser(params: any) {
  // throw new Error('Function not implemented.')
}

export function getTest(params: any) {
  // throw new Error('Function not implemented.')
}

// 用户请求列表
export const fetchUserList = async (data: any = {}) => {
  return http({
    url: '/user/userlist',
    method: 'POST',
    data,
  })
}

// 用户请求列表删除操作
export const fetchDeleteUserList = async (data: any) => {
  return http({
    url: '/user/deleteUserList',
    method: 'POST',
    data,
  })
}

// 用户更新列表
export const fetchEditUserItem = async (data: any) => {
  return http({
    url: '/user/updateUserList',
    method: 'POST',
    data,
  })
}
